Package com.fsf.news.repository
Class NewsSourcesRepositoryTest
java.lang.Object
com.fsf.news.repository.NewsSourcesRepositoryTest
@ExtendWith(GuiceExtension.class) @ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
class NewsSourcesRepositoryTest
extends Object
Unit tests for the NewsSourcesRepository class.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) com.fasterxml.jackson.databind.ObjectMapper(package private) com.fsf.news.repository.NewsSourcesRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidTests that the findAll method returns the expected sources results when available.(package private) voidTests that the findAllSources method returns the expected sources when available.(package private) voidTests that the findAllSources method returns an empty list when searching for sources in a different session.(package private) voidTests that the findAll method returns the expected sources results when the maximum capacity is exceeded.(package private) voidTests that the findAll method returns an empty list when searching for sources results in a different session.(package private) voidTests that the findAll method returns an empty list when no sources results are available.(package private) voidTests that the findAll method returns the expected sources results when the maximum capacity is reached.(package private) voidTests that the findAllSources method returns an empty list when no sources are available.(package private) voidtestSave()Tests that the save method adds a sources result and returns the expected sources result.
-
Field Details
-
objectMapper
@Inject @Named("objectMapperJSON") com.fasterxml.jackson.databind.ObjectMapper objectMapper -
repository
@InjectMocks com.fsf.news.repository.NewsSourcesRepository repository
-
-
Constructor Details
-
NewsSourcesRepositoryTest
NewsSourcesRepositoryTest()
-
-
Method Details
-
testFindAllEmpty
@Test void testFindAllEmpty()Tests that the findAll method returns an empty list when no sources results are available. -
testFindAll
@Test void testFindAll()Tests that the findAll method returns the expected sources results when available. -
testFindAllDifferentSession
@Test void testFindAllDifferentSession()Tests that the findAll method returns an empty list when searching for sources results in a different session. -
testFindAllMaxCapacity
@Test void testFindAllMaxCapacity()Tests that the findAll method returns the expected sources results when the maximum capacity is reached. -
testFindAllBeyondCapacity
@Test void testFindAllBeyondCapacity()Tests that the findAll method returns the expected sources results when the maximum capacity is exceeded. -
testFindAllSourcesEmpty
@Test void testFindAllSourcesEmpty()Tests that the findAllSources method returns an empty list when no sources are available. -
testFindAllArticles
Tests that the findAllSources method returns the expected sources when available.- Throws:
IOException- If an I/O error occurs
-
testFindAllArticlesDifferentSession
Tests that the findAllSources method returns an empty list when searching for sources in a different session.- Throws:
IOException- If an I/O error occurs
-
testSave
@Test void testSave()Tests that the save method adds a sources result and returns the expected sources result.
-